var isIE=navigator.userAgent.toLowerCase().indexOf("msie")>-1;var isMoz=document.implementation&&document.implementation.createDocument;var isSafari=((navigator.userAgent.toLowerCase().indexOf("safari")!=-1)&&(navigator.userAgent.toLowerCase().indexOf("mac")!=-1))?true:false;function curvyCorners(){if(typeof (arguments[0])!="object"){throw newCurvyError("First parameter of curvyCorners() must be an object.")}if(typeof (arguments[1])!="object"&&typeof (arguments[1])!="string"){throw newCurvyError("Second parameter of curvyCorners() must be an object or a class name.")}if(typeof (arguments[1])=="string"){var G=0;var A=getElementsByClass(arguments[1])}else{var G=1;var A=arguments}var D=new Array();if(arguments[0].validTags){var F=arguments[0].validTags}else{var F=["div"]}for(var C=G,B=A.length;C0){this.box.innerHTML=""}this.applyCorners=function(){for(var Z=0;Z<2;Z++){switch(Z){case 0:if(this.settings.tl||this.settings.tr){var W=document.createElement("DIV");W.style.width="100%";W.style.fontSize="1px";W.style.overflow="hidden";W.style.position="absolute";W.style.paddingLeft=this.borderWidth+"px";W.style.paddingRight=this.borderWidth+"px";var R=Math.max(this.settings.tl?this.settings.tl.radius:0,this.settings.tr?this.settings.tr.radius:0);W.style.height=R+"px";W.style.top=0-R+"px";W.style.left=0-this.borderWidth+"px";this.topContainer=this.box.appendChild(W)}break;case 1:if(this.settings.bl||this.settings.br){var W=document.createElement("DIV");W.style.width="100%";W.style.fontSize="1px";W.style.overflow="hidden";W.style.position="absolute";W.style.paddingLeft=this.borderWidth+"px";W.style.paddingRight=this.borderWidth+"px";var X=Math.max(this.settings.bl?this.settings.bl.radius:0,this.settings.br?this.settings.br.radius:0);W.style.height=X+"px";W.style.bottom=0-X+"px";W.style.left=0-this.borderWidth+"px";this.bottomContainer=this.box.appendChild(W)}break}}if(this.topContainer){this.box.style.borderTopWidth="0px"}if(this.bottomContainer){this.box.style.borderBottomWidth="0px"}var d=["tr","tl","br","bl"];for(var h in d){if(h>-1<4){var c=d[h];if(!this.settings[c]){if(((c=="tr"||c=="tl")&&this.topContainer!=null)||((c=="br"||c=="bl")&&this.bottomContainer!=null)){var V=document.createElement("DIV");V.style.position="relative";V.style.fontSize="1px";V.style.overflow="hidden";if(this.backgroundImage==""){V.style.backgroundColor=this.boxColour}else{V.style.backgroundImage=this.backgroundImage}switch(c){case"tl":V.style.height=R-this.borderWidth+"px";V.style.marginRight=this.settings.tr.radius-(this.borderWidth*2)+"px";V.style.borderLeft=this.borderString;V.style.borderTop=this.borderString;V.style.left=-this.borderWidth+"px";break;case"tr":V.style.height=R-this.borderWidth+"px";V.style.marginLeft=this.settings.tl.radius-(this.borderWidth*2)+"px";V.style.borderRight=this.borderString;V.style.borderTop=this.borderString;V.style.backgroundPosition="-"+(R+this.borderWidth)+"px 0px";V.style.left=this.borderWidth+"px";break;case"bl":V.style.height=X-this.borderWidth+"px";V.style.marginRight=this.settings.br.radius-(this.borderWidth*2)+"px";V.style.borderLeft=this.borderString;V.style.borderBottom=this.borderString;V.style.left=-this.borderWidth+"px";V.style.backgroundPosition="-"+(this.borderWidth)+"px -"+(this.boxHeight+(X+this.borderWidth))+"px";break;case"br":V.style.height=X-this.borderWidth+"px";V.style.marginLeft=this.settings.bl.radius-(this.borderWidth*2)+"px";V.style.borderRight=this.borderString;V.style.borderBottom=this.borderString;V.style.left=this.borderWidth+"px";V.style.backgroundPosition="-"+(X+this.borderWidth)+"px -"+(this.boxHeight+(X+this.borderWidth))+"px";break}}}else{if(this.masterCorners[this.settings[c].radius]){var V=this.masterCorners[this.settings[c].radius].cloneNode(true)}else{var V=document.createElement("DIV");V.style.height=this.settings[c].radius+"px";V.style.width=this.settings[c].radius+"px";V.style.position="absolute";V.style.fontSize="1px";V.style.overflow="hidden";var M=parseInt(this.settings[c].radius-this.borderWidth);for(var T=0,g=this.settings[c].radius;T=M){var O=-1}else{var O=(Math.floor(Math.sqrt(Math.pow(M,2)-Math.pow((T+1),2)))-1)}if(M!=g){if((T)>=M){var L=-1}else{var L=Math.ceil(Math.sqrt(Math.pow(M,2)-Math.pow(T,2)))}if((T+1)>=g){var J=-1}else{var J=(Math.floor(Math.sqrt(Math.pow(g,2)-Math.pow((T+1),2)))-1)}}if((T)>=g){var I=-1}else{var I=Math.ceil(Math.sqrt(Math.pow(g,2)-Math.pow(T,2)))}if(O>-1){this.drawPixel(T,0,this.boxColour,100,(O+1),V,-1,this.settings[c].radius)}if(M!=g){for(var S=(O+1);S=L){if(L==-1){L=0}this.drawPixel(T,L,this.borderColour,100,(J-L+1),V,0,0)}}else{if(J>=O){this.drawPixel(T,(O+1),this.borderColour,100,(J-O),V,0,0)}}var Q=this.borderColour}else{var Q=this.boxColour;var J=O}if(this.settings.antiAlias){for(var S=(J+1);S0)?0:-1),this.settings[c].radius)}}}this.masterCorners[this.settings[c].radius]=V.cloneNode(true)}if(c!="br"){for(var Z=0,f=V.childNodes.length;Z0){var a=document.createElement("DIV");a.style.position="relative";a.innerHTML=this.boxContent;a.className="autoPadDiv";var n=Math.abs(R-this.boxPadding);var p=Math.abs(X-this.boxPadding);if(R1||G<0){G=1}var H=Math.round((D*G)+(C*(1-G)));if(H>255){H=255}if(H<0){H=0}var B=Math.round((K*G)+(I*(1-G)));if(B>255){B=255}if(B<0){B=0}var A=Math.round((F*G)+(E*(1-G)));if(A>255){A=255}if(A<0){A=0}return"#"+IntToHex(H)+IntToHex(B)+IntToHex(A)}function IntToHex(A){base=A/16;rem=A%16;base=base-(rem/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS+""+remS}function MakeHex(A){if((A>=0)&&(A<=9)){return A}else{switch(A){case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F"}}}function pixelFraction(H,G,A){var C=0;var B=new Array(1);var F=new Array(1);var I=0;var D="";var E=Math.sqrt((Math.pow(A,2)-Math.pow(H,2)));if((E>=G)&&(E<(G+1))){D="Left";B[I]=0;F[I]=E-G;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(G+1,2)));if((E>=H)&&(E<(H+1))){D=D+"Top";B[I]=E-H;F[I]=1;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(H+1,2)));if((E>=G)&&(E<(G+1))){D=D+"Right";B[I]=1;F[I]=E-G;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(G,2)));if((E>=H)&&(E<(H+1))){D=D+"Bottom";B[I]=E-H;F[I]=0}switch(D){case"LeftRight":C=Math.min(F[0],F[1])+((Math.max(F[0],F[1])-Math.min(F[0],F[1]))/2);break;case"TopRight":C=1-(((1-B[0])*(1-F[1]))/2);break;case"TopBottom":C=Math.min(B[0],B[1])+((Math.max(B[0],B[1])-Math.min(B[0],B[1]))/2);break;case"LeftBottom":C=(F[0]*B[1])/2;break;default:C=1}return C}function rgb2Hex(B){try{var C=rgb2Array(B);var G=parseInt(C[0]);var E=parseInt(C[1]);var A=parseInt(C[2]);var D="#"+IntToHex(G)+IntToHex(E)+IntToHex(A)}catch(F){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex")}return D}function rgb2Array(A){var C=A.substring(4,A.indexOf(")"));var B=C.split(", ");return B}function setOpacity(F,C){C=(C==100)?99.999:C;if(isSafari&&F.tagName!="IFRAME"){var B=rgb2Array(F.style.backgroundColor);var E=parseInt(B[0]);var D=parseInt(B[1]);var A=parseInt(B[2]);F.style.backgroundColor="rgba("+E+", "+D+", "+A+", "+C/100+")"}else{if(typeof (F.style.opacity)!="undefined"){F.style.opacity=C/100}else{if(typeof (F.style.MozOpacity)!="undefined"){F.style.MozOpacity=C/100}else{if(typeof (F.style.filter)!="undefined"){F.style.filter="alpha(opacity:"+C+")"}else{if(typeof (F.style.KHTMLOpacity)!="undefined"){F.style.KHTMLOpacity=C/100}}}}}}function inArray(C,B){for(var A=0;Acurrent+1){case true:moveTo(current+(target-current)/3);window.setTimeout(step,50);timer=1;break;default:timer=0;break}}function glideTo(A,B){target=A;mem_target=A;if(timer==0){window.setTimeout(step,50);timer=1}caption_id=B;caption=img_div.getElementsByTagName("img")[array_images[caption_id]].getAttribute("alt");if(caption==""){caption=" "}caption_div.innerHTML=caption;if(dragging==false){new_slider_pos=(scrollbar_width*(-(A*100/((max-1)*xstep)))/100)-new_posx;if(!isNaN(new_slider_pos)){slider_div.style.marginLeft=(new_slider_pos-conf_slider_width)+"px"}}}function moveTo(L){current=L;var J=max;var A=img_div.getElementsByTagName("img");for(var F=0;Fmem_target){D.style.visibility="hidden";D.style.display="none"}else{var H=Math.sqrt(10000+L*L)+100;var B=L/H*size+size;D.style.display="block";var C=(D.h/D.w*D.pc)/H*size;switch(C>max_height){case false:var G=D.pc/H*size;break;default:C=max_height;var G=D.w*C/D.h;break}var E=(images_width*0.34-C)+images_top+((C/(conf_reflection_p+1))*conf_reflection_p);D.style.left=B-(D.pc/2)/H*size+images_left+"px";if(G&&C){D.style.height=C+"px";D.style.width=G+"px";D.style.top=E+"px"}D.style.visibility="visible";switch(L<0){case true:J++;break;default:J=J-1;break}switch(D.i==caption_id){case false:D.onclick=function(){glideTo(this.x_pos,this.i)};D.className="imageFlowImg";break;default:J=J+1;var I=function(M){myLytebox.start(Event.element(M?M:window.event).link,true)};D.onclick=I;D.className="imageFlowImgNonTransparent";$("imageFlowLink").style.left=D.style.left;$("imageFlowLink").style.top=D.style.top;if(D.style.width!=""){$("imageFlowLink").style.width=(parseInt(D.style.width)+7)+"px"}if(D.style.height!=""){$("imageFlowLink").style.height=(parseInt(D.style.height)+7)+"px"}$("imageFlowLink").style.display="";$("imageFlowLink").link=D.link;$("imageFlowLink").onclick=I;break}D.style.zIndex=J}L+=xstep}}function moveImageFlowNextRight(){if((caption_id+1)=0){glideTo($("imageFlow["+(caption_id-1)+"]").x_pos,caption_id-1)}}function refresh(F){imageflow_div=document.getElementById(conf_imageflow);img_div=document.getElementById(conf_images);scrollbar_div=document.getElementById(conf_scrollbar);slider_div=document.getElementById(conf_slider);caption_div=document.getElementById(conf_captions);if(!imageflow_div.initialized){return }caption_id=0;new_caption_id=0;current=0;target=0;mem_target=0;timer=0;array_images=new Array();new_slider_pos=0;dragging=false;dragobject=null;dragx=0;posx=0;new_posx=0;xstep=150;images_width=img_div.offsetWidth;var A=999;if(navigator.appVersion.indexOf("MSIE")!=-1){A=parseFloat(navigator.appVersion.split("MSIE")[1])}images_top=imageflow_div.offsetTop+(A<7)?186:75;images_left=imageflow_div.offsetLeft;max_conf_focus=conf_focus*xstep;size=images_width*0.5;scrollbar_width=410;conf_slider_width=conf_slider_width*0.5;max_height=images_width*0.51;imageflow_div.style.height=max_height+"px";img_div.style.height=(images_width*0.338+15+80)+"px";caption_div.style.width=images_width+"px";caption_div.style.marginTop=images_width*0.03+"px";scrollbar_div.style.marginTop=images_width*0.02+"px";scrollbar_div.style.marginLeft="20px";scrollbar_div.style.width=scrollbar_width+"px";slider_div.onmousedown=function(){dragstart(this)};slider_div.style.cursor=conf_slider_cursor;max=img_div.getElementsByTagName("img").length;var D=0;var B=img_div.getElementsByTagName("img");for(var C=0;C(E.h/(conf_reflection_p+1))){case true:E.pc=118;break;default:E.pc=100;break}E.url=E.getAttribute("longdesc");E.style.cursor=conf_images_cursor;D++}}max=array_images.length;moveTo(current);glideTo(current,caption_id);if(max>2){glideTo($("imageFlow["+(Math.round(max/2)-1)+"]").x_pos,Math.round(max/2)-1)}}function show(B){var A=document.getElementById(B);A.style.visibility="visible"}function hide(B){var A=document.getElementById(B);A.style.visibility="hidden";A.style.display="none"}window.onload=function(){if(document.getElementById(conf_imageflow)){hide(conf_loading);refresh(true);show(conf_images);show(conf_scrollbar);initMouseWheel();initMouseDrag()}};window.onresize=function(){if(document.getElementById(conf_imageflow)){refresh()}};window.onunload=function(){/*document=null*/};function handle(B){imageflow_div=document.getElementById(conf_imageflow);if(imageflow_div==undefined||!imageflow_div.initialized){return }var A=false;switch(B>0){case true:if(caption_id>=1){target=target+xstep;new_caption_id=caption_id-1;A=true}break;default:if(caption_id<(max-1)){target=target-xstep;new_caption_id=caption_id+1;A=true}break}if(A==true){glideTo(target,new_caption_id)}}function wheel(A){var B=0;if(!A){A=window.event}if(A.wheelDelta){B=A.wheelDelta/120}else{if(A.detail){B=-A.detail/3}}if(B){handle(B)}if(A.preventDefault){A.preventDefault()}A.returnValue=false}function initMouseWheel(){if(window.addEventListener){imageflow_div.addEventListener("DOMMouseScroll",wheel,false)}imageflow_div.onmousewheel=wheel}function dragstart(A){dragobject=A;dragx=posx-dragobject.offsetLeft+new_slider_pos}function dragstop(){dragobject=null;dragging=false}function drag(F){posx=document.all?window.event.clientX:F.pageX;if(dragobject!=null){dragging=true;if(!isNaN(dragx)){new_posx=(posx-dragx)+conf_slider_width;if(new_posx<(-new_slider_pos)){new_posx=-new_slider_pos}if(new_posx>(scrollbar_width-new_slider_pos)){new_posx=scrollbar_width-new_slider_pos}var B=(new_posx+new_slider_pos);var E=B/((scrollbar_width)/(max-1));var D=Math.round(E);var A=(D)*-xstep;var C=D;dragobject.style.left=new_posx+"px";glideTo(A,C)}}}function initMouseDrag(){document.onmousemove=drag;document.onmouseup=dragstop;document.onselectstart=function(){if(dragging==true){return false}else{return true}}}function getKeyCode(A){A=A||window.event;return A.keyCode}document.onkeydown=function(B){var A=getKeyCode(B);switch(A){case 39:handle(-1);break;case 37:handle(1);break}}; var buttonEvents={};if(null==is2)var is2={};null==is2.util&&(is2.util={});is2.util.removeElements=function(b,c){for(var a=$(b).firstChild,d;null!=a;)d=a.nextSibling,"undefined"!=typeof a.id&&a.id.substring(0,c.length)==c&&a.id!=c&&$(b).removeChild(a),a=d}; is2.util.disableElement=function(b){var c=dwr.util.byId(b);if("button"==$(b).type)c.disabled=!0;else if("icoContent"==$(b).className){var a=c.style.backgroundImage;-1==a.indexOf("_disabled")&&(a=a.substr(0,a.lastIndexOf("."))+"_disabled"+a.substr(a.lastIndexOf("."),a.length),c.style.backgroundImage=a);a=c.onclick;null!=a&&(buttonEvents[b+".onclick"]=a,c.onclick=null)}}; is2.util.enableElement=function(b){var c=dwr.util.byId(b);if("button"==$(b).type)c.disabled=!1;else if("icoContent"==$(b).className){var a=c.style.backgroundImage;-1!=a.indexOf("_disabled")&&(a=a.replace(/_disabled/g,""),c.style.backgroundImage=a);"undefined"!=typeof buttonEvents&&null!=buttonEvents&&(a=buttonEvents[b+".onclick"],null!=a&&(c.onclick=a,buttonEvents[b+".onclick"]=null))}};is2.util.trimString=function(b){if(null==b)return b;/^\s*(.*)\s*$/.exec(b);return null==RegExp.$1?b:RegExp.$1};var ICON_IMMO_OBJECT,ICON_IMMO_OBJECT_SELECTED;function createGoogleIcons(){ICON_IMMO_OBJECT={url:ICON_IMMO_OBJECT_URL,anchor:new google.maps.Point(11,11),size:new google.maps.Size(21,22),scaledSize:new google.maps.Size(21,22)};ICON_IMMO_OBJECT_SELECTED={url:ICON_IMMO_OBJECT_URL_SELECTED,anchor:new google.maps.Point(11,11),size:new google.maps.Size(21,22),scaledSize:new google.maps.Size(21,22)}};function LoginParameters(a){this.presentationId=void 0!=a&&null!=a?a:PRESENTATION_ID;this.mandatorId=MANDATOR_ID;this.userCode=USER_CODE} function ImmoObjectsSearchParameters(a){this.constructor(LoginParameters);this.presentationId=void 0!=a&&null!=a?a:PRESENTATION_ID;this.elementsPerPage=null;this.currentPage=1;this.orderBy=null;this.objectIdentifier=2;this.dateEnd=this.dateStart=this.personCount=this.category=this.regions=this.maximumLocation=this.minimumLocation=this.city=this.radius=this.chosenLocation=this.areaEnd=this.areaStart=this.roomsEnd=this.roomsStart=this.priceEnd=this.priceStart=this.allowedObjectIdentifiers=null} ImmoObjectsSearchParameters.prototype=new LoginParameters;function ImmoObjectParameters(a,b,c){this.constructor(LoginParameters);this.presentationId=void 0!=b&&null!=b?b:PRESENTATION_ID;this.id=a;this.code=c}ImmoObjectParameters.prototype=new LoginParameters; function InquiryParameters(a){this.constructor(LoginParameters);this.presentationId=void 0!=a&&null!=a?a:PRESENTATION_ID;this.earningtype=this.haustiere=this.wbs=this.familyStatus=this.birthplace=this.mobile=this.childrenBirthdays=this.anzahlPersonen=this.adultCount=this.anzahlKinder=this.job=this.birthday=this.distributionChannel=this.isBooking=this.comment=this.childrenCountOfBooking=this.adultCountOfBooking=this.membership=this.dateTo=this.dateFrom=this.infoPerson=this.salutation=this.phone=this.email= this.city=this.postalCode=this.streetNumber=this.street=this.firstName=this.lastName=null}InquiryParameters.prototype=new LoginParameters; function AgentParameters(a){this.constructor(LoginParameters);this.presentationId=void 0!=a&&null!=a?a:PRESENTATION_ID;this.minRooms=this.minArea=this.maxPrice=this.radius=this.location=this.salutation=this.phone=this.email=this.city=this.postalCode=this.streetNumber=this.street=this.firstName=this.lastName=null;this.specialties=[];this.remark=this.earningtype=this.haustiere=this.mobile=this.familyStatus=this.childrenBirthdays=this.adultCount=this.distributionChannel=this.anzahlKinder=this.floor= this.wbs=this.beruf=this.nettoEinkommen=this.etage=this.freiAb=this.maxRooms=this.maxArea=this.minPrice=this.birthday2=this.birthday=this.firstName2=this.lastName2=this.objectIdentifiers=this.regions=this.company=this.realLocation=this.latitude=this.longitude=this.comment=this.categoryIds=this.categories=this.categoryId=this.category=null}AgentParameters.prototype=new LoginParameters;// Validation rules for all fields of a form are specified via a hierarchical OOP structure // ----- Entry error types ----- // Abstract entry error type function AbstractEntryErrorType() { this.message = "Eingabefehler!"; this.validate = function(value) { alert("Call of abstract method not allowed!"); }; this.getMessage = function() { return this.message; }; } function EntryRequired(message) { this.constructor(AbstractEntryErrorType); this.message = message != null ? message : "Eingabe erforderlich!"; this.validate = function(value) { return value != null && is2.util.trimString(value).length > 0; }; } EntryRequired.prototype = new AbstractEntryErrorType(); function MustBeEmpty(message) { this.constructor(AbstractEntryErrorType); this.message = message != null ? message : "Keine Eingabe erlaubt!"; this.validate = function(value) { return value == null || value.length == 0; }; } MustBeEmpty.prototype = new AbstractEntryErrorType(); function MinimumLength(minLen, message) { this.constructor(AbstractEntryErrorType); this.message = message != null ? message : "Eingabe muss mindestens " + minLen + " Zeichen lang sein!"; this.validate = function(value) { return value != null && is2.util.trimString(value).length >= minLen; }; } MinimumLength.prototype = new AbstractEntryErrorType(); function RegExpMustMatch(regularExp, message) { this.constructor(AbstractEntryErrorType); this.regularExp = regularExp; this.message = message != null ? message : "Eingabe inkorrekt!"; this.validate = function(value) { return value != null && value.match(regularExp); }; } RegExpMustMatch.prototype = new AbstractEntryErrorType(); // An OR function for error types (In the validation in class EntryField all error type // validations have to be correct (AND function)). function AtLeastOneMustBeCorrect(errorTypes, message) { this.constructor(AbstractEntryErrorType); this.errorTypes = errorTypes; this.message = message != null ? message : concatenateMessages(); this.validate = function(value) { for (var i = 0; i < errorTypes.length; i++) { var errType = errorTypes[i]; if (errType.validate(value)) { return true; } } return false; }; // Private methods (known only in constructor) function concatenateMessages() { var totalMsg = "Sämtliche der folgenden Eingabefehler sind aufgetreten: "; for (var i = 0; i < errorTypes.length; i++) { var errType = errorTypes[i]; if (i > 0) { totalMsg += ", "; } totalMsg += errType.getMessage(); } return totalMsg; }; } AtLeastOneMustBeCorrect.prototype = new AbstractEntryErrorType(); // An entry field can vulnerable for multiple kinds of entry errors function EntryField(elementId, errorTypes) { this.elementId = elementId; this.errorTypes = errorTypes; this.validate = function() { var value = dwr.util.byId(elementId).value; var success = true; var i = 0; var errType = null; while (i < errorTypes.length && success) { errType = errorTypes[i]; success = errType.validate(value); i++; } if (!success) { dwr.util.setValue(elementId + ".error-message", errType.getMessage()); } var showErrMsgEl = dwr.util.byId(elementId + ".show.error-message"); showErrMsgEl.style.display = success ? "none" : ""; return success; }; this.focus = function() { dwr.util.byId(elementId).focus(); }; this.blur = function() { dwr.util.byId(elementId).blur(); }; this.hideErrorMessage = function() { var showErrMsgEl = dwr.util.byId(elementId + ".show.error-message"); showErrMsgEl.style.display = "none"; }; this.highlightIfRequiredField = function() { var i = 0; while (i < errorTypes.length) { var errType = errorTypes[i]; if (errType instanceof EntryRequired) { var el = dwr.util.byId(elementId); el.className = "required"; return; } i++; } }; } function EntryForm(fields) { this.fields = fields; highlightRequiredFields(); this.validate = function() { var totalSuccess = true; for (var i = 0; i < fields.length; i++) { var field = fields[i]; var fieldSuccess = field.validate(); if (!fieldSuccess && totalSuccess) { totalSuccess = false; // Focus the first field which had an error field.focus(); } } return totalSuccess; }; this.focusFirstField = function() { fields[0].focus(); }; this.hideErrorMessages = function() { for (var i = 0; i < fields.length; i++) { var field = fields[i]; field.hideErrorMessage(); } }; this.blurFocusedField = function() { // There is no way of finding out which field of the form (if any) is currently // focused. So all fields are blurred to make sure the no field is being focused // anymore. for (var i = 0; i < fields.length; i++) { var field = fields[i]; field.blur(); } }; // Private methods (known only in constructor) function highlightRequiredFields() { for (var i = 0; i < fields.length; i++) { var field = fields[i]; field.highlightIfRequiredField(); } } } var currentPage=1,totalPages=1E3,objectId="",objectCode="",embedded=!1,presentationId,defaultLocation="",defaultRadius="",defaultSortOrder="",defaultRegions="",defaultCity="",defaultDateStart="",defaultDateEnd="",defaultSpecialties="",defaultIdentifier="",defaultShowAgentForm="false",skippedLocationAllowed=!1,specialtiesToRestore="",initialRegions=[],objectAlreadyShown=!1,bookmarkUrlTemplate=null,showTwitterButton=!1,showFacebookButton=!1,presentMap=null,onlyLoadGoogleMap=!1,cmpConsentStatusForGoogleMaps= !1,usercentricsConsent={},usercentricsInitialized=!1,closeInitialViewOneTime=!0,AvailableSortOrders={distanceToChosenLocationAsc:"immoObject.distanceToChosenLocation asc",monatlGesamtkostenAsc:"immoObject.monatlGesamtkosten asc",monatlGesamtkostenDesc:"immoObject.monatlGesamtkosten desc",anzahlZimmerAsc:"immoObject.anzahlGanzeZimmer asc, immoObject.anzahlHalbeZimmer asc",anzahlZimmerDesc:"immoObject.anzahlGanzeZimmer desc, immoObject.anzahlHalbeZimmer desc",wohnflaecheAsc:"immoObject."+Configuration.AREA_SORTING_FIELD+ " asc",wohnflaecheDesc:"immoObject."+Configuration.AREA_SORTING_FIELD+" desc"};void 0==window.immoObjectTracker&&(window.immoObjectTracker=null);void 0==window.immoObjectListTracker&&(window.immoObjectListTracker=null);void 0==window.tracker&&(window.tracker=null); var searchRequestHint=!1,filter=new ImmoObjectsSearchParameters(presentationId),filterTest=new ImmoObjectsSearchParameters(presentationId),currentDetailedImmoObject=null,locationChosen=!1,objectsInNotepad=[],detailWindow,imageFlowDirection="none",imageFlowStopped=!0,imageFlowMoveStarted=!1,imageFlowMoveDelay=300; Array.prototype.mkStr=function(a,b,c){for(var d=[],e=0;eb.length&&a.id.substr(0,b.length)==b){var f=a.id.charAt(b.length);if("."==f||"["==f)e=c+a.id.substr(b.length)}e?(d.SUPERCACHE[a.id.substr(b.length+1)]&&dwr.util.setValue(a,d.SUPERCACHE[a.id.substr(b.length+1)]),a.setAttribute("id",e),elemsCache[e]=a):a.removeAttribute("id")}a=a.childNodes;for(e=0;e100*(b.height-c.height)/b.height?(a.style.height="auto",a.style.width=c.width+"px"):(a.style.height=c.height+"px",a.style.width="auto")} function calcThumbDim(a,b,c,d){var e=a,f=b;c||(c=Configuration.MAX_THUMB_WIDTH);d||(d=Configuration.MAX_THUMB_HEIGHT);if(a>c||b>d)f=Math.floor(b/(1*a/c)),e=c,f>d&&(e=Math.floor(a/(1*b/d)),f=d),e>c&&(e=c);return{width:e,height:f}}function calcThumbFilename(a){if(a){var b=a.lastIndexOf(".");0d.getDate()?"0":"")+d.getDate()+"."+(10>d.getMonth()+1?"0":"")+(d.getMonth()+1)+"."+d.getFullYear(); if(0d?(b+=String.fromCharCode(d),c++):191d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}; function cloneObject(a){var b=a instanceof Array?[]:{},c;for(c in a){var d=a[c];if("object"==typeof d)if(d instanceof Array){b[c]=[];for(var e=0;eb.options.maxLabelSize&&(d=d.substring(0,b.options.maxLabelSize)+"...");b.button.set("label",d)}};b.onComboHide=function(){$(this.options.targetId).style.zIndex= $(this.options.targetId).oldZIndex;this._onSelection(this.oldSelection,this.getCheckedNodesAsValueList(!1));this.oldSelection=void 0};b._init=function(){defineCustomYahooTypes();b.tree=new YAHOO.widget.TreeView(b.options.targetTreeId);b.tree.subscribe("checkClick",b._onTreeChecked);b.content=new YAHOO.widget.Panel(this.options.id+"_content",{visible:!1,close:!1});$(b.options.targetTreeId).style.display="";b.content.setBody($(b.options.targetTreeId));if(b.options.footer){var a=document.createElement("div"); a.className="treeComboFooter";b.content.body.appendChild(a);for(var d=0;d=b.getTime()&&a.getTime()<=c.getTime()},isDate:function(a,b,c,d){return dates.withinDate(workingDate,start(b,c,d),end(b,c,d))},sameDate:function(a,b){return a.getDate()=== b.getDate()&&a.getMonth()===b.getMonth()&&a.getFullYear()===b.getFullYear()},formatDate:function(a){return a.getDate()+"."+(a.getMonth()+1)+"."+a.getFullYear()},formatDateYUI:function(a){return a.getMonth()+1+"/"+a.getDate()+"/"+a.getFullYear()}}; function initCalender(a,b){var c=-1!=a.className.indexOf("toolbarItem");c&&($("detailView").calendarButton=a);var d=c?[a]:a.getElementsByClassName("calender-list-button");if(d&&0=k;k++)e.calendar.addWeekdayRenderer(k,d);e.calendar.render();e.calendar.renderEvent.subscribe(function(){e.dialog.fireEvent("changeContent")})}d=e.calendar.getSelectedDates();0 0) { var overlay = overlaysOfMap.pop() overlay.setMap(null) overlay = null } overlays[mapName] = null } } // Load javascript fields dynamically function jsImport(src){ var scriptElem = document.createElement('script'); scriptElem.setAttribute('src', src); scriptElem.setAttribute('type', 'text/javascript'); document.getElementsByTagName('head')[0].appendChild(scriptElem); } function addToMap(immoObject, position) { if (immoObject.labels.latitude != null && immoObject.labels.latitude != 0 && immoObject.labels.longitude != null && immoObject.labels.longitude != 0) { var information = document.getElementById("mapMarkerTemplate[" + position + "]").innerHTML; var objOnMap = new ImmoObjectOnMap( new google.maps.LatLng(immoObject.labels.latitude, immoObject.labels.longitude), information); immoObjectsOnMap.push(objOnMap); } else { immoObjectsOnMap.push(null); } } function initGoogleMap() { // Init map /* if (typeof GUnload == 'undefined') { alert(ERROR_MESSAGE_NO_CONNECTION_TO_GOOGLE_MAPS); return; } */ googleMap = new google.maps.Map(mapView, { mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: true, scaleControl: true, // Kilometers and miles are shown in the map panControl: false, // The pan control allows to move up, down, left and right in the map //zoom: 14, minZoom: 4, // Most of Europe can be completely displayed but not the whole world zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL }, streetViewControl: true } ) if (customizeGoogleMap) { googleMap = customizeGoogleMap(googleMap) } chosenLocationIcon = { anchor: new google.maps.Point(9, 24), url: '../../shared/img/pin_blue.png', size: new google.maps.Size(32, 32) } } function initDetailsGoogleMap() { //console.log("immo_objects_in_google_map.js - Function initDetailsGoogleMap") if ($("#tabContent6")) { detailGoogleMap = new google.maps.Map(object_map_canvas, { mapTypeId: google.maps.MapTypeId.HYBRID, zoom: 17, minZoom: 4, // Most of Europe can be completely displayed but not the whole world zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL }, mapTypeControl: true, scaleControl: true, panControl: false, // The pan control allows to move up, down, left and right in the map streetViewControl: true } ) if (customizeDetailGoogleMap) { detailGoogleMap = customizeDetailGoogleMap(detailGoogleMap) } } } function refreshDetailGoogleMap() { //console.log("immo_objects_in_google_map.js - Function refreshDetailGoogleMap") //console.log("Street view visible: " + detailGoogleMap.getStreetView().getVisible()) // If the google map detail view had been closed with street view activated it shall not be opened again with // street view activated (at the same position as when the immo object detail pop-up was closed) but the map // shall be shown in its default hybrid view if ($("#tabContent6")) { initDetailsGoogleMap(); if (detailGoogleMap.getStreetView().getVisible()) detailGoogleMap.getStreetView().setVisible(false) var lat = $("detailView").results.immoObject.labels.latitude; var lng = $("detailView").results.immoObject.labels.longitude; clearOverlays('detailGoogleMap') var bounds = new google.maps.LatLngBounds() // Implemented checkResize alternative for maps //detailGoogleMap.checkResize(); google.maps.event.trigger(detailGoogleMap, 'resize'); var coord = new google.maps.LatLng(lat, lng); bounds.extend(coord); detailGoogleMap.setCenter(coord); detailGoogleMap.setMapTypeId(google.maps.MapTypeId.HYBRID); var marker = new google.maps.Marker( { map: detailGoogleMap, icon: ICON_IMMO_OBJECT, position: coord, optimized: false // Image may be animated (e.g. for WBGD) }) addToOverlays('detailGoogleMap', marker) detailGoogleMap.setZoom(17) } } function refreshGoogleMap() { // console.log("immo_objects_in_google_map.js - Function refreshGoogleMap") // If street view is currently shown in the main map of the presentation and the search criteria are modified so // that the matching immo objects may change (e. g. another address is entered) or the results are paged and // another page is selected the street view is switched off again if (googleMap.getStreetView().getVisible()) googleMap.getStreetView().setVisible(false) // Initialize bounds var bounds = new google.maps.LatLngBounds(); for (var i=0; i < immoObjectsOnMap.length; i++) { var objOnMap = immoObjectsOnMap[i]; if (objOnMap != null) { var coordinates = objOnMap.coordinates; bounds.extend(coordinates); } } if (locationChosen && chosenLocationMarker != null) { // Location marker (if one is set) is always shown in map when it is redrawn bounds.extend(chosenLocationMarker.getPosition()); } //alert("Bounds: SW: " + bounds.getSouthWest() + " NE: " + bounds.getNorthEast()); googleMap.setCenter(bounds.getCenter()); // Initialize markers if (currentOpenInfoWindow != null) { currentOpenInfoWindow.close() //immoObjectMarkerOfCurrentOpenInfoWindow = null infoWindowOfImmoObjectMarkerIsClosed() } clearOverlays('googleMap') // Set marker to show the chosen location if (locationChosen && chosenLocationMarker != null) { chosenLocationMarker.setMap(googleMap) addToOverlays('googleMap', chosenLocationMarker) } for (var i=0; i < immoObjectsOnMap.length; i++) { function getMarkerAction(marker, information) { // Remove the height style from the div with class="pic". That avoids scroll bars in the info windows // on MSIE, Google Chrome and Safari which otherwise would be shown if the height of the immo object // info shown in the info window would exceed the height of its casket in the list left to the map. // That doesn't work with Firefox. In Firefox the info windows of immo object markers may still have // scroll bars. // information = // information.replace( // /(<(div|DIV)\s+class=(['"]?)pic\3\s+style=(['"])[^\4]*)(height|HEIGHT)\s*:\s*[^;]+;/, // '$1' // ) return function() { // if (typeof console !== 'undefined') // console.info(information) // Only one info window opened at a time if (currentOpenInfoWindow != null) { currentOpenInfoWindow.close() //immoObjectMarkerOfCurrentOpenInfoWindow = null infoWindowOfImmoObjectMarkerIsClosed() } var infoWindow = new google.maps.InfoWindow( { content: //'
' + information + "
" information }) infoWindow.open(googleMap, marker) currentOpenInfoWindow = infoWindow immoObjectMarkerOfCurrentOpenInfoWindow = marker google.maps.event.addListener(infoWindow, "closeclick", infoWindowCloseonMap) } } var objOnMap = immoObjectsOnMap[i]; if (objOnMap != null) { var coordinates = objOnMap.coordinates; var marker = new google.maps.Marker( { map: googleMap, icon: ICON_IMMO_OBJECT, position: coordinates, zIndex: Z_INDEX_OF_IMMO_OBJECT_MARKER, optimized: false // May be animated for some mandators (e. g. WBGD) }) addToOverlays('googleMap', marker) google.maps.event.addListener(marker, "click", getMarkerAction(marker, objOnMap.information //document.getElementById('mapMarkerTemplate[1]').childNodes[1] ) ) google.maps.event.addListener(marker, "mouseover", overMapObject) google.maps.event.addListener(marker, "mouseout", outMapObject) google.maps.event.addListener(marker, "click", clickMapObject) immoObjectsMarkers[i] = marker; } else { immoObjectsMarkers[i] = null; } } // if only one object is in map, set zoom level to 15 if (immoObjectsOnMap.length == 1) { googleMap.setZoom(15); } else { // googleMap.setZoom( // googleMap.getBoundsZoomLevel(bounds)); // 12) googleMap.fitBounds(bounds) } // Debug info // showArea(); // defineArea(); } /** * Performs reverse geocoding */ function lookupAddress(defaultAddress, latitude, longitude, callback) { var geocoder = new google.maps.Geocoder(); geocoder.geocode( { region: 'de', location: new google.maps.LatLng(latitude, longitude), }, function (result, status) { var p = null if (status == google.maps.GeocoderStatus.OK) { result = filterGeoResults(result) /* p = findFirstPlacemarkWith(result.Placemark, ['countryCode', 'country', 'city', 'postalCode'], function (pm) { return isCmpEmpty(pm.cmp.streetAndNumber) || !(/^L\d+$/.test(pm.cmp.streetAndNumber)) }) */ if (result.length >= 1) { p = result[0] } } if (p) callback( //getFullAddress(p), result[0].formatted_address, latitude, longitude ) else callback(defaultAddress, latitude, longitude) }); } function newLocation(searchLocation, latitude, longitude){ lookupAddress(searchLocation, latitude, longitude, function (address, lat, lng) { dwr.util.byId('locationDescription').value = address.replace(/, (Germany|Deutschland)$/, "") // uncommented, because of no new search by onchange of filter // searchImmoObjects(); } ) } /** * Finds if a given point is within a polygon. * * Based on Bob Stein's inpoly() function for C. * http://home.earthlink.net/~bobstein/inpoly/ * * Modified for JavaScript by Scott Andrew LePera. * * Parameters: * poly: array containing x/y coordinate pairs that * describe the vertices of the polygon. Format is * indentical to that of HTML image maps, i.e. [x1,y1,x2,y2,...] * * px: the x-coordinate of the target point. * * py: the y-coordinate of the target point. * * Return value: * true if the point is within the polygon, false if not. */ function isPointInPoly(poly, px, py) { var npoints = poly.length; // number of points in polygon var xnew,ynew,xold,yold,x1,y1,x2,y2,i; var inside=false; if (npoints/2 < 3) { // points don't describe a polygon return false; } xold=poly[npoints-2]; yold=poly[npoints-1]; for (i=0 ; i < npoints ; i=i+2) { xnew=poly[i]; ynew=poly[i+1]; if (xnew > xold) { x1=xold; x2=xnew; y1=yold; y2=ynew; } else { x1=xnew; x2=xold; y1=ynew; y2=yold; } if ((xnew < px) == (px <= xold) && ((py-y1)*(x2-x1) < (y2-y1)*(px-x1))) { inside=!inside; } xold=xnew; yold=ynew; } return inside; } /** * Is the geo-coordinate, given as parameter, in the predefined polys? * * @param coordinate The geo-coordinate to be checked if it is in the area of polygons */ function isMapCoordinateInPolys(coordinate) { if (!Configuration.SEARCH_AREAS || Configuration.SEARCH_AREAS.length == 0) { return true } var polys = window.POLY_CACHE if (!polys) { polys = [] for (var i = 0; i < Configuration.SEARCH_AREAS.length; i++) { var poly = Configuration.SEARCH_AREAS[i] var arr = [] polys.push(arr) for (var j = 0; j < poly.length; j++) { var p = poly[j] arr.push(p[1]); arr.push(p[0]); } } window.POLY_CACHE = polys } for (var i = 0; i < polys.length; i++) { var res = isPointInPoly(polys[i], coordinate.lng(), coordinate.lat()) if (res) { return true; } } return false; } function showArea() { if (!Configuration.SEARCH_AREAS || Configuration.SEARCH_AREAS.length == 0) { alert ("No areas defined") return; } for (var i = 0; i < Configuration.SEARCH_AREAS.length; i++) { var poly = Configuration.SEARCH_AREAS[i] var arr = [] for (var j = 0; j < poly.length; j++) { var p = poly[j] arr.push(new GLatLng(p[0], p[1])); } var polygon = new GPolygon(arr,'#279212', 3, 0.6, '#3DE21B', 0.6); googleMap.addOverlay(polygon); } } function defineArea() { /*if (typeof console !== 'undefined') console.info("Function defineArea")*/ var div = document.createElement("div") div.style.left = "0" div.style.top = "0" div.style.position = "fixed" div.style.width = "400px" div.style.height = "500px" div.style.border = "2px solid black" div.style.zIndex = "100000" div.style.backgroundColor = "white" div.style.overflow = "auto" div.style.padding = "10px" var latlong = document.createElement("div") div.appendChild(latlong) var points = [] var pol = null var mark = null var l = document.createElement("div") var clear = document.createElement("a") clear.innerHTML = "Clear" clear.style.color = "#B51010" clear.style.padding = "10px" clear.style.cursor = "pointer" clear.onclick = function () { l.innerHTML = "" points = [] if (pol) { po.setMap(null) } if (mark) { mark.setMap(null) } } div.appendChild(clear) div.appendChild(l) document.body.appendChild(div) google.maps.event.addListener(googleMap, "mousemove", function(point){ latlong.innerHTML = "Lat: " + point.lat() + "
" + "Long: " + point.lng() }); google.maps.event.addListener(googleMap, "click", function(o, point, o1) { if(!point && o1) { point = o1; } if (point) { points.push(point) var s = document.createElement("div"); s.innerHTML = "[" + point.lat() + ", " + point.lng() + "]," l.appendChild(s) if (pol) { pol.setMap(null) } if (mark) { mark.setMap(null) } pol = new GPolygon(points,'#B30303', 3, 0.6, '#ED827D', 0.6); googleMap.addOverlay(pol); mark = new GMarker(point); googleMap.addOverlay(mark); } }); } /** * Get the address component of a type given as parameter type from an array of address components which is given as * parameter addressComponents. * * @param {Array} addressComponents The address components of one of the results * of a geocoding. * @param {string} type A type of an address component, e. g. 'postal_code' for the ZIP of the address. * @returns {google.maps.GeocoderAddressComponent} The address component having the required type or null if no * address component has the required type. */ function getAddressComponentOfType(addressComponents, type) { for (var i = 0; i < addressComponents.length; i++) { var addressComponent = addressComponents[i] for (var j = 0; j < addressComponent.types.length; j++) { if (addressComponent.types[j] == type) { return addressComponent } } } return null } /** * Check if among the address components given as parameter addressComponents an address component with the type given * as parameter type exists. * * @param {Array} addressComponents The address components of one of the results * of a geocoding. * @param {string} type A type of an address component, e. g. 'postal_code' for the ZIP of the address. * @returns {boolean} true if one (or more) of the address components has the type, otherwise false. */ function hasAddressComponentOfType(addressComponents, type) { return getAddressComponentOfType(addressComponents, type) != null } /** * Get the short name of the country of the address components of one of the results of a geocoding. * E. g. for a result which is in Germany 'de' would be returned. * * @param {Array} addressComponents The address components of one of the results * of a geocoding. * @returns {string} The short name of the country of the address components given as parameter. */ function getCountryCodeOfAddressComponents(addressComponents) { var countryAddrComp = getAddressComponentOfType(addressComponents, 'country') return countryAddrComp.short_name } /** * Check if the adress components given as parameter have the minimum required information for an address to be * used as position. That would be the country (Only localities in Germany are allowed as address) and the * specification of the city (by its locality, e. g. 'Berlin' or its ZIP). * * @param {Array} addressComponents The address components of one of the results * of a geocoding. * @returns {boolean} true if the address components contain the required types, otherwise false. */ function hasAddressComponents(addressComponents) { return addressComponents.length > 0 && ( hasAddressComponentOfType(addressComponents, 'locality') || hasAddressComponentOfType(addressComponents, 'postal_code') ) && hasAddressComponentOfType(addressComponents, 'country') } /** * From the locations resulting from a geocoding the locations which are not in Germany are removed from the result set * of matching locations and, if the areas where the presentation has immo objects are restricted by polygons (defined * by Configuration.SEARCH_AREAS in javascript-config.jsp-configuration-files), locations which are not inside the * areas of these polygons are also removed. * The remaining locations are returned. * * @param {Array} result The locations of a geocoding. * @returns {Array} The locations of that geocoding which match the requirements of the * presentation (e. g. being in Germany). */ function filterGeoResults(result) { //var locations = this.removeDuplicates(result) var resFinal = [] for (var i = 0; i < result.length; i++) { var location = result[i] if ( // If the location is not in Germany or polygons have been declared in which the location has to be // and it is not in those polygons the location is filtered out from the geo results hasAddressComponents(location.address_components) && !( ( //location.address_components.length > 0 && getCountryCodeOfAddressComponents(location.address_components).toLowerCase() != 'de' ) || !this.isMapCoordinateInPolys(location.geometry.location) ) ) { // Do we already have that location? (No duplicates may be in the resulting list) var isDuplicate = false for(var j = 0; j < resFinal.length; j++) { var alreadyLoc = resFinal[j] if ( alreadyLoc.formatted_address === location.formatted_address && alreadyLoc.geometry.location.equals(location.geometry.location) ) { isDuplicate = true break } } if (!isDuplicate) { resFinal.push(location) } } } return resFinal } // ----- Callback functions ----- function BingGeocodeCallback(result) { var errorText; if (result && result.resourceSets && result.resourceSets.length > 0 && result.resourceSets[0].resources && result.resourceSets[0].resources.length == 0) { errorText = "Es konnte kein Ort unter der angegebenen Bezeichnung gefunden werden!" disableObjects(errorText); return; } if (!result) { errorText = "Beim Versuch, die Koordinaten des eingegebenen Ortes zu ermitteln,
" + "kam es zu einem Fehler auf dem Maps Server.
" + "Versuchen Sie es bitte erneut!"; disableObjects(errorText); return; } if (result && result.resourceSets && result.resourceSets.length > 0 && result.resourceSets[0].resources && result.resourceSets[0].resources.length > 0) { var latitude = parseFloat(result.resourceSets[0].resources[0].point.coordinates[0]); var longitude = parseFloat(result.resourceSets[0].resources[0].point.coordinates[1]); var locationCenter = {latitude: latitude, longitude: longitude}; var distanceInKm = parseFloat(dwr.util.getValue("radius")); var distanceInMeters = distanceInKm * 1000; var northPoint, westPoint, southPoint, eastPoint = null; Microsoft.Maps.loadModule('Microsoft.Maps.SpatialMath', function () { northPoint = Microsoft.Maps.SpatialMath.getDestination(locationCenter, 0, distanceInMeters, Microsoft.Maps.SpatialMath.DistanceUnits.Meters); westPoint = Microsoft.Maps.SpatialMath.getDestination(locationCenter, 270, distanceInMeters, Microsoft.Maps.SpatialMath.DistanceUnits.Meters); southPoint = Microsoft.Maps.SpatialMath.getDestination(locationCenter, 180, distanceInMeters, Microsoft.Maps.SpatialMath.DistanceUnits.Meters); eastPoint = Microsoft.Maps.SpatialMath.getDestination(locationCenter, 90, distanceInMeters, Microsoft.Maps.SpatialMath.DistanceUnits.Meters); filter.chosenLocation = { latitude: latitude, longitude:longitude }; filter.radius = distanceInKm; filter.minimumLocation = { latitude: southPoint.latitude, longitude: westPoint.longitude } filter.maximumLocation = { latitude: northPoint.latitude, longitude: eastPoint.longitude } refreshImmoObjectList(); }); } else { refreshImmoObjectList(); } } function searchImmoObjectsByLocation(result, status) { // console.info("Function searchImmoObjectsByLocation") if (status != google.maps.GeocoderStatus.OK) { var errorText; switch (status) { case google.maps.GeocoderStatus.ZERO_RESULTS : errorText = "Kein Ort mit Bezeichnung '" // + result.formatted_address + enteredAddress + "' bekannt!" break; case google.maps.GeocoderStatus.UNKNOWN_ERROR : errorText = "Beim Versuch, die Koordinaten des eingegebenen Ortes zu ermitteln,
" + "kam es zu einem Fehler auf dem Google Maps Server.
" + "Versuchen Sie es bitte erneut!"; break; default : errorText = status; } var buffer ="" + "Fehler bei Suche per Ortsbezeichnung:
" + errorText + "
"; disableObjects(buffer); return; } // Filter out all placemarks which are not in Germany result = filterGeoResults(result) if (result.length == 0) { var buffer = "" + "Fehler bei Suche per Ortsbezeichnung:
" // + "Leider verf�gen wir über keine Angebote in der Nähe Ihrer Suchregion." + "Die eingegebene Suchregion kann nicht verwendet werden.

" + "Mögliche Ursachen:
" + "- Die eingegebene Suchregion befindet sich nicht in Deutschland (Es wurde z. B. "Washington"" + " eingegeben).
" + "- Die Eingabe beschränkt sich nicht auf eine Stadt (Es wurde z. B. lediglich der Name eines" + " Bundeslands eingegeben).
" + ( Configuration.SEARCH_AREAS && Configuration.SEARCH_AREAS.length > 0 ? "- Es werden grundsätzlich nur Immobilien in bestimmten Städten angeboten und die" + " eingegebene Suchregion war außerhalb dieser Städte.
" : "" ) + "
"; disableObjects(buffer, true); return; } // Was more than one location found matching the query? if (result.length > 1) { var buffer = "" + "Die Suche per Ortsbezeichnung brachte mehr als ein Ergebnis!" + "
" + "Eingegebene Ortsbezeichnung: '" //+ result[0].formatted_address + enteredAddress + "', Zahl an passenden Orten: " + result.length + "

Passende Orte:
" + ""; disableObjects(buffer, true); return; } // A unique location was found var coordinates = result[0].geometry.location processLocationPlacemark( //getFullAddress(result[0].address_components), result[0].formatted_address, coordinates.lat(), coordinates.lng() ) } function processLocationPlacemark(fullAddress, latitude, longitude) { // console.info("Function processLocationPlacemark") var locationCenter = new google.maps.LatLng(latitude, longitude) var distanceInKm = parseFloat(dwr.util.getValue("radius")) var distanceInMeters = distanceInKm * 1000 // console.info("locationCenter: " + locationCenter + ", distanceInMeters: " + distanceInMeters) // XMaps isn't used anymore, using Google Maps JS API package google.maps.geometry instead var northPoint = google.maps.geometry.spherical.computeOffset(locationCenter, distanceInMeters, 0) var westPoint = google.maps.geometry.spherical.computeOffset(locationCenter, distanceInMeters, 270) var southPoint = google.maps.geometry.spherical.computeOffset(locationCenter, distanceInMeters, 180) var eastPoint = google.maps.geometry.spherical.computeOffset(locationCenter, distanceInMeters, 90) // console.info("latitude: " + latitude + ", longitude: " + longitude + ", northPoint: " + northPoint // + ", northPoint lat.: " + northPoint.lat()) filter.chosenLocation = { latitude: latitude, longitude:longitude } filter.radius = distanceInKm filter.minimumLocation = { latitude: southPoint.lat(), longitude: westPoint.lng() } filter.maximumLocation = { latitude: northPoint.lat(), longitude: eastPoint.lng() } /* console.info("minimumLocation lat.: " + filter.minimumLocation.latitude + ", minimumLocation lon.: " + filter.minimumLocation.longitude + ", maximumLocation.lat.: " + filter.maximumLocation.latitude + ", maximumLocation lon.: " + filter.maximumLocation.longitude) */ locationChosen = true; searchRequestHint = true; // Define location marker chosenLocationMarker = new google.maps.Marker( { icon:chosenLocationIcon, position: locationCenter }) function getChosenLocationMarkerAction(marker, locationName) { return function() { dwr.util.setValue("locationMarkerTemplate.locationName", locationName); dwr.util.setValue("locationMarkerTemplate.radius", distanceInKm); var html = document.getElementById("locationMarkerTemplate").innerHTML; // Only one info window opened at a time if (currentOpenInfoWindow != null) { currentOpenInfoWindow.close() //immoObjectMarkerOfCurrentOpenInfoWindow = null infoWindowOfImmoObjectMarkerIsClosed() } var infoWindow = new google.maps.InfoWindow( { content: html }) infoWindow.open(googleMap, marker) currentOpenInfoWindow = infoWindow immoObjectMarkerOfCurrentOpenInfoWindow = marker //google.maps.event.addListener(infoWindow, "closeclick", infoWindowCloseonMap) } } var addressName = fullAddress; addressName = addressName.replace(/, (Germany|Deutschland)$/, ""); google.maps.event.addListener(chosenLocationMarker, "click", getChosenLocationMarkerAction(chosenLocationMarker, addressName)); dwr.util.setValue("locationDescription", addressName); refreshImmoObjectList(); } // ----- Functions used by the callback functions ----- /* // Placemark.address sometimes is not unique. Lohbr�gge in Schleswig-Holstein e.g. has // Placemark.address "Lohbr�gge, Germany" which also matches Lohbr�gge in Hamburg. If Lohbr�gge // in Schleswig-Holstein is the placemark parameter of this function the result will be the // unique address "Lohbr�gge, Schleswig-Holstein, Germany". // This operation is only done for german placemarks. For other countries the Placemark.address // is returned. function getFullAddress(addressComponent) { var c = addressComponent.cmp return [ c.streetAndNumber, c.district, [c.postalCode, c.city].mkStr(" "), c.state != c.city ? c.state : null ].mkStr(", ") } */ var present = {} present.Map = Class.create({ options : { validatorFn: null, field: null, formatter: null, locale: null, errorMessage: "Validation error in field '{0}'", additionalPlaceholders: {} }, initialize: function (options) { this.options = $H(this.options).merge(options).toObject() }, loadMap: function (loadedCallbackName) {}, prepareMapAfterLoad: function () {}, initDetailsMap: function () {}, initMap: function () {}, getMarkerTemplate: function () {}, addMarker: function (immoObject, counter) {}, refreshMap: function () {}, isMapAvailable: function (immoObject) { return immoObject.labels.latitude != null && immoObject.labels.latitude != 0 && immoObject.labels.longitude != null && immoObject.labels.longitude != 0 }, geocodeLocation: function (location) {} }) present.GoogleMap = Class.create(present.Map, { defOptions: {}, initialize: function ($super, options) { this.defOptions = $H(this.defOptions).merge(options).toObject() Object.extend(this.defOptions, options) $super(this.defOptions) }, loadMap: function (loadedCallbackName) { var script = document.createElement("script"); script.type = "text/javascript"; script.src = this.getGooglemapScriptUrl(loadedCallbackName); document.body.appendChild(script); }, getGooglemapScriptUrl: function (callback) { // return "http://maps.google.com/maps?file=api&v=2&sensor=false&key=" // + MandatorConstants.GOOGLE_MAPS_KEY + "&async=2&callback=" + callback; return "//maps.googleapis.com/maps/api/js?libraries=geometry,places&v=3.53&key=" + MandatorConstants.GOOGLE_MAPS_KEY + "&client=" + MandatorConstants.GOOGLE_MAPS_CLIENT_ID + "&channel=" + MandatorConstants.GOOGLE_MAPS_CHANNEL + "&language=de&callback=" + callback }, prepareMapAfterLoad: function () { createGoogleIcons() }, initDetailsMap: function () { initDetailsGoogleMap() }, initMap: function () { // If I try to use the visualRefresh look the texts in the info windows (of the markers) aren't styled anymore // Since 2013-11-19 the maps now by default have the look they had before only when the visual refresh had been // explicitly set to true. Since Google Maps JS API ver. 3.14 the visual style is the only style available. // google.maps.visualRefresh = true initGoogleMap() }, getMarkerTemplate: function () { return 'mapMarkerTemplate' }, addMarker: function (immoObject, counter) { addToMap(immoObject, counter); }, refreshMap: function () { refreshGoogleMap() }, /** * Client side geocoding. No access limitation problems. * * @see http://googlemapsapi.blogspot.com/2007/09/coming-soon-ip-based-geocode-limiting.html */ geocodeLocation: function (address) { //console.info("Function geocodeLocation (Client side geocoding)") if (typeof google.maps.Geocoder == 'undefined') { alert(ERROR_MESSAGE_NO_CONNECTION_TO_GOOGLE_MAPS) } else { var geocoder = new google.maps.Geocoder() // Note the entered address so that it can be shown in a message as the latest entered address if more // than one address matches the entered address enteredAddress = address//.trim() //geocoder.setBaseCountryCode("de"); geocoder.geocode( { region: 'de', address: address }, searchImmoObjectsByLocation ) } } }) //present.OSMMap = Class.create(present.Map, { // defOptions: {}, // // initialize: function ($super, options) { // this.defOptions = $H(this.defOptions).merge(options).toObject() // Object.extend(this.defOptions, options) // $super(this.defOptions) // }, // // loadMap: function (loadedCallbackName) { // window[loadedCallbackName]() // }, // // prepareMapAfterLoad: function () { // // }, // // initDetailsMap: function () { //// initDetailsGoogleMap() // }, // // initMap: function () { // this._initIcons() // this.map = new OpenLayers.Map("mapView"); // // var mapnik = new OpenLayers.Layer.OSM(); // // this.map.addLayer(mapnik); // // var markers = new OpenLayers.Layer.Markers( "Markers" ); // this.map.addLayer(markers); // // var size = new OpenLayers.Size(21,25); // var offset = new OpenLayers.Pixel(-(size.w/2), -size.h); // var icon = new OpenLayers.Icon('http://www.openlayers.org/dev/img/marker.png', size, offset); // // // markers.addMarker(new OpenLayers.Marker(this.latLng(52.52, 13.41), this.chosenLocationIcon.clone())); // markers.addMarker(new OpenLayers.Marker(this.latLng(52.52, 13.42), this.immoObjectIcon.clone())); // markers.addMarker(new OpenLayers.Marker(this.latLng(52.52, 13.43), this.immoObjectIcon.clone())); // markers.addMarker(new OpenLayers.Marker(this.latLng(52.52, 13.44), this.immoObjectIcon.clone())); // //// this.map.setCenter(pos, 15) // this.map.zoomToExtent(markers.getDataExtent()); // }, // // _initIcons: function () { // this.chosenLocationIcon = this.icon('../../shared/img/pin_blue.png', 32, 32, 9, 24) // this.immoObjectIcon = this.icon(ICON_IMMO_OBJECT_URL, 21, 22, 11, 11) // }, // //// marker: function (lat, lng, icon, text) { //// var marker = new OpenLayers.Marker(this.latLng(lat, lng), icon.clone()) //// //// marker.events.register('mouseover', marker, function(evt) { //// //// // Get the location of the mouse when entering object //// //// var mx = document.all ? window.event.clientX : ; //// var my = 0; //// //// if (document.all) { //// mx = window.event.clientX; //// my = window.event.clientY; //// } else { //// mx = evt.pageX; //// my = evt.pageY; //// } //// //// var posx = mx + "px"; //// var posy = my + "px"; //// //// //// // set up the mini report of attributes for the tooltip //// //// var atts = document.getElementById("attributes"); //// //// atts.innerHTML = "
"; //// //// atts.innerHTML += "Name : " + sitingName + "
Contact : " + sitingContact + "
siting Date: " + sitingDate + "
Time of day : " + sitingTime + "
Sighting Type : " + sitingType + "
Comm Election Bdy : " + sitingElectoralBdy + "
Local Govt : " + sitingLocalGovt + "
Suburb : " + sitingSuburbs + "
Description : " + sitingDescription; //// //// //// // make adjustment to the div within thge map div //// //// atts.style.position = 'absolute'; //// //// atts.style.top = posy; //// //// atts.style.left = posx; //// //// atts.style.display = 'block'; //// //// Event.stop(evt); //// //// } //// }, // // icon: function (name, width, height, aLeft, aTop) { // var size = new OpenLayers.Size(21,25); // var offset = new OpenLayers.Pixel(aLeft, aTop); // return new OpenLayers.Icon(name, size, offset); // }, // // latLng: function (lat, lng) { // return new OpenLayers.LonLat(lng, lat) // Center of the map // .transform( // new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984 // new OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection // ) // }, // // getMarkerTemplate: function () { //// return 'mapMarkerTemplate' // }, // // addMarker: function (immoObject, counter) { //// addToMap(immoObject, counter); // }, // // refreshMap: function () { //// refreshGoogleMap() // }, // // isMapAvailable: function (immoObject) { // return immoObject.labels.latitude != null && // immoObject.labels.latitude != 0 && // immoObject.labels.longitude != null && // immoObject.labels.longitude != 0 // }, // // geocodeLocation: function (location) { // refreshImmoObjectList() // } //}) present.MapQuestMap = Class.create(present.Map, { defOptions: {}, initialize: function ($super, options) { this.defOptions = $H(this.defOptions).merge(options).toObject() Object.extend(this.defOptions, options) $super(this.defOptions) this.objectsToAdd = [] }, loadMap: function (loadedCallbackName) { window[loadedCallbackName]() }, prepareMapAfterLoad: function () { this._initIcons() }, initDetailsMap: function () { // initDetailsGoogleMap() }, initMap: function () { MQA.withModule('smallzoom', 'largezoom', 'mousewheel', function() { this.map = new MQA.TileMap($('mapView'), 3, {lat: 51.09662294502995, lng: 10.01953125}, 'map', {height: "100px"}) this.mainCollection = new MQA.ShapeCollection() this.map.addControl( new MQA.LargeZoom(), new MQA.MapCornerPlacement(MQA.MapCorner.TOP_RIGHT, new MQA.Size(5,5)) ) this.map.enableMouseWheelZoom() this.map.addShapeCollection(this.mainCollection); if (this.refreshNeeded) this.refreshMap() }.bind(this)) }, marker: function (latLng, icon, title, body, listeners) { window.poi = new MQA.Poi(latLng); // poi.setBias({x: 0, y: -1}); // cool stuff poi.setInfoTitleHTML(title); poi.setInfoContentHTML(body); if (listeners) { for (var event in listeners) { MQA.EventManager.addListener(poi, event, listeners[event].bind(poi)) } } if (icon) { this._setMarkerIcon(poi, icon) } poi.latLng = new MQA.LatLng(latLng.lat, latLng.lng) return poi }, _setMarkerIcon: function (poi, icon) { poi.setIcon(icon); if (icon.offset) poi.setIconOffset(new MQA.Point(icon.offset.x, icon.offset.y)); }, _initIcons: function () { this.chosenLocationIcon = new MQA.Icon("../../shared/img/pin_blue.png", 32, 32) this.chosenLocationIcon.offset = {x: -12, y: -26} this.immoObjectIcon = new MQA.Icon(ICON_IMMO_OBJECT_URL, 21, 22) this.immoObjectSelectedIcon = new MQA.Icon(ICON_IMMO_OBJECT_URL_SELECTED, 21, 22) }, getMarkerTemplate: function () { return 'mapMarkerTemplate' }, addMarker: function (immoObject, counter) { this.objectsToAdd.push(immoObject) }, refreshMap: function () { var me = this if (!this.mainCollection) { this.refreshNeeded = true return } this.map.removeAllShapes() this.mainCollection = new MQA.ShapeCollection() this.objectsToAdd.map(function (obj, idx) { var body = document.getElementById("mapMarkerTemplate[" + idx + "]").innerHTML; return me.marker( { lat: obj.labels.latitude, lng: obj.labels.longitude }, me.immoObjectIcon, "" + obj.labels.titel + "", body, { rolloveropen: function () { selectImmoObjectInList(idx) me._setMarkerIcon(this, me.immoObjectSelectedIcon) }, rolloverclose: function () { deselectImmoObjectInList(idx, this.isInfoWindowOpen) me._setMarkerIcon(this, me.immoObjectIcon) }, infowindowopen: function () { this.isInfoWindowOpen = true /*if (typeof console !== 'undefined') console.info(me.mainCollection)*/ me.mainCollection.each(function (other, otherIdx) { deselectImmoObjectInList(other, other.isInfoWindowOpen) }) markImmoObjectInList(idx) me._setMarkerIcon(this, me.immoObjectIcon) }, infowindowclose: function () { /*if (typeof console !== 'undefined') console.info('present.MapQuest.refreshMap:infowindowclose')*/ this.isInfoWindowOpen = false deselectImmoObjectInList(idx, this.isInfoWindowOpen) } }) }).each(function (m) {me.mainCollection.add(m)}) if (locationChosen) { me.marker( {lat: obj.labels.latitude, lng: obj.labels.longitude}, me.chosenLocationIcon, "Immo object title", document.getElementById("mapMarkerTemplate[" + position + "]").innerHTML) } this.objectsToAdd = [] this.map.addShapeCollection(this.mainCollection); this.map.zoomToRect(this.mainCollection.getBoundingRect()) }, geocodeLocation: function (location) { refreshImmoObjectList() } }) present.BingMap = Class.create(present.Map, { defOptions: {}, initialize: function ($super, options) { this.defOptions = $H(this.defOptions).merge(options).toObject() Object.extend(this.defOptions, options) $super(this.defOptions) this.objectsToAdd = []; this.pushpins = []; this.currentIdInResultList = null; }, loadMap: function (loadedCallbackName) { window[loadedCallbackName]() }, prepareMapAfterLoad: function () {}, initDetailsMap: function () {}, initMap: function () { this.map = new Microsoft.Maps.Map(document.getElementById('mapView'), { credentials: MandatorConstants.BING_MAPS_KEY }); }, marker: function (latLng, icon, title, body, listeners) {}, getMarkerTemplate: function () { return 'mapMarkerTemplate' }, addMarker: function (immoObject, counter) { this.objectsToAdd.push(immoObject) }, refreshMap: function () { this.initMap(); this.pushpins = []; // remove all pushpins for (var i = this.map.entities.getLength() - 1; i >= 0; i--) { var pushpin = this.map.entities.get(i); if (pushpin instanceof Microsoft.Maps.Pushpin) { this.map.entities.removeAt(i); } } // add pushpins and info boxes for (i = 0; i < this.objectsToAdd.length; i++) { var obj = this.objectsToAdd[i]; if (obj.labels.latitude && obj.labels.longitude) { var pushpin = new Microsoft.Maps.Pushpin({latitude: obj.labels.latitude, longitude: obj.labels.longitude}, { icon: ICON_IMMO_OBJECT_URL, anchor: new Microsoft.Maps.Point(24, 24) }); // data for info box (title and description) var infoBoxTitle = obj.labels.titel ? obj.labels.titel : ""; var ort = obj.labels.ort; var strasse = obj.labels.strasse; var hausnummer = obj.labels.hausnummer; var anzahlZimmer = obj.labels.anzahlZimmer; var wohnflaeche = obj.labels.wohnflaeche; var nutzflaeche = obj.labels.nutzflache; var monatlGesamtkosten = obj.labels.monatlGesamtkosten; var infoBoxDescription = ""; if (ort) { infoBoxDescription = infoBoxDescription + ort; } if (strasse) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + ", " + strasse : infoBoxDescription; if (hausnummer) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + " " + hausnummer : infoBoxDescription; } } if (anzahlZimmer) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + ", " + anzahlZimmer + " Zimmer" : infoBoxDescription; } if (wohnflaeche) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + ", " + wohnflaeche + " m²" : infoBoxDescription; } else if (nutzflaeche) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + ", " + nutzflaeche + " m²" : infoBoxDescription; } if (monatlGesamtkosten) { infoBoxDescription = infoBoxDescription.length > 0 ? infoBoxDescription + ", " + monatlGesamtkosten + " €" : infoBoxDescription; } // store some metadata with the pushpin pushpin.metadata = { title: infoBoxTitle, description: infoBoxDescription }; pushpin.custId = i; // set the info box var infobox = new Microsoft.Maps.Infobox({latitude: obj.labels.latitude, longitude: obj.labels.longitude}, { visible: false }); infobox.setMap(this.map); // show info box, when pin is clicked Microsoft.Maps.Events.addHandler(pushpin, 'click', function (args) { infobox.setOptions( { location: args.target.getLocation(), title: args.target.metadata.title, description: args.target.metadata.description, visible: true } ); }); idx = 5; // replace pushpin icon by mouseover Microsoft.Maps.Events.addHandler(pushpin, 'mouseover', function (e, idx) { e.target.setOptions({ icon: ICON_IMMO_OBJECT_URL_SELECTED }); $("immoObjectTemplate[" + e.target.custId + "]").style.backgroundImage = 'url(img/back_isobject_selected1.jpg)'; }); // back to standard pushpin icon by mouseout Microsoft.Maps.Events.addHandler(pushpin, 'mouseout', function (e, idx) { e.target.setOptions({ icon: ICON_IMMO_OBJECT_URL }); $("immoObjectTemplate[" + e.target.custId + "]").style.backgroundImage = 'url(img/back_isobject.gif)'; }); this.pushpins.push(pushpin); } this.map.entities.push(this.pushpins); } if (this.objectsToAdd.length > 0) { var mapBounds = this._getLocationRect(); if (mapBounds) { this.map.setView({bounds: mapBounds}); } } this.objectsToAdd = []; }, geocodeLocation: function (address) { var credentials = MandatorConstants.BING_MAPS_KEY; var geocodeRequest = "//dev.virtualearth.net/REST/v1/Locations?query=" + encodeURI(address) + "&output=json&jsonp=BingGeocodeCallback&key=" + credentials; var script = document.createElement("script"); script.setAttribute("type", "text/javascript"); script.setAttribute("src", geocodeRequest); document.body.appendChild(script); }, _getLocationRect: function() { // get the rectangle in which all pins are located to zoom to rectangle of all pins in map var latitudes = []; var longitudes = []; var minLatitute = null; var maxLatitude = null; var minLongitude = null; var maxLongitude = null; var box = null; for (i = 0; i < this.objectsToAdd.length; i++) { var obj = this.objectsToAdd[i]; if (obj.labels.latitude) latitudes.push(obj.labels.latitude); if (obj.labels.longitude) longitudes.push(obj.labels.longitude); } if (latitudes.length > 0 && longitudes.length > 0) { minLatitute = Math.min.apply(null, latitudes); minLongitude = Math.min.apply(null, longitudes); maxLatitude = Math.max.apply(null, latitudes); maxLongitude = Math.max.apply(null, longitudes); } if (minLatitute && minLongitude && maxLatitude && maxLongitude) { box = new Microsoft.Maps.LocationRect.fromEdges(maxLatitude, minLongitude, minLatitute, maxLongitude); } return box; } }) present.NoMap = Class.create(present.Map, { initialize: function ($super, options) { $super(options) }, loadMap: function (loadedCallbackName) { window[loadedCallbackName]() }, prepareMapAfterLoad: function () {}, initDetailsMap: function () {}, initMap: function () {}, getMarkerTemplate: function () {return null}, addMarker: function (immoObject, counter) {}, refreshMap: function () {}, isMapAvailable: function (immoObject) {return false}, geocodeLocation: function (location) { alert("Geocoding is not supported because map is disabled!") } }) var locationChoicesAlwaysAtBottom=!1,sortSelectBox=null,ImmoSolve={EmptyValueField:function(a,b,c){this.elem=$(a);this.emptyValue=c?$(b).innerHTML:b;var d=this;this.onClick=function(){if(this.elem.emptyVal||this.elem.value==this.emptyValue)this.elem.value="",this.elem.style.color="#666666",this.elem.emptyVal=!0};this.onBlur=function(){""==this.elem.value?(this.setBlankText(),this.elem.emptyVal=!0):this.elem.emptyVal=this.elem.value!=this.emptyValue?!1:!0};this.onChange=function(){this.elem.value== this.emptyValue||""==this.elem.value?(this.setBlankText(),this.elem.emptyVal=!0):this.elem.emptyVal=!1};this.setBlankText=function(){var a=this.emptyValue,b=this.elem;b.style.color="#B0B0B0";b.value=a};this.init=function(){this.onBlur();Event.observe(this.elem,"focus",function(){d.onClick()});Event.observe(this.elem,"click",function(){d.onClick()});Event.observe(this.elem,"blur",function(){d.onBlur()});Event.observe(window,"unload",function(){d.elem.value=""})};this.init()}}; function onSortChangeTrack(){null!=immoObjectListTracker&&immoObjectListTracker.trackEvent("SortOrderChanged",dwr.util.getValue("sortOrder").gsub(/immoObject\./,""))}function themeSpecificInit(){sortSelectBox=new Autocompleter.SelectBox("sortOrder",{onChange:"onSortChangeTrack();"})}function toggleDisp(){for(var a=0;a=a&&($("lisNotePadControlBottom").className="downNotepadListDisabled"))} function enableNotepadPaggingButtonsTS(a){a>MAX_OBJECTS_IN_VIEWPORT?(0==ScrollCounter?$("lisNotePadControlTop").className="upNotepadListDisabled":$("lisNotePadControlTop").className="upNotepadListEnabled",ScrollCounter*SCROLL_OBJECTS_COUNT+MAX_OBJECTS_IN_VIEWPORT>=a?$("lisNotePadControlBottom").className="downNotepadListDisabled":$("lisNotePadControlBottom").className="downNotepadListEnabled"):($("lisNotePadControlTop").className="upNotepadListDisabled",$("lisNotePadControlBottom").className="downNotepadListDisabled"); $("lisNotePadControlBottom").numberOfObjects=a;$("lisNotePadControlTop").numberOfObjects=a;0!=ScrollCounter&&moveUp(ScrollCounter)}function disableObjects(a,b,c,d,f,e){setTimeout(function(){if("location"==Configuration.SEARCH_TYPE||f)$("locationDescription")&&$("locationDescription").focus(),buffer=a,$("locationChoices").innerHTML=buffer,showLocationChoices(b,c,d,f);new Effect.Appear("noResultView",{duration:.4});e||hideSearchOrder()},400)} function showLocationChoices(a,b,c,d){if("location"==Configuration.SEARCH_TYPE||d){var f=d=null;$("location")&&(d=$("location").cumulativeOffset(),f=$("location").getDimensions());b?(c&&($("locationChoices").style.width=c+"px"),d=$("ispage").cumulativeOffset(),a=$("ispage").getDimensions(),b=$("locationChoices").getDimensions(),$("locationChoices").style.top=d.top+(a.height/2-b.height/2)+"px",$("locationChoices").style.left=d.left+(a.width/2-b.width/2)+"px"):(a||locationChoicesAlwaysAtBottom?$("locationChoices").style.top= d.top+26+"px":$("locationChoices").style.top=d.top-$("locationChoices").getHeight()+"px",$("locationChoices").style.left=d.left+"px",$("locationChoices").style.width=f.width-20-2+"px");new Effect.Appear("locationChoices",{duration:.4})}}function hideLocationChoices(){"none"!=$("locationChoices").style.display&&new Effect.Fade("locationChoices",{duration:.4})} function handleLocationRequired(){if(skippedLocationAllowed)return!1;if("location"==Configuration.SEARCH_TYPE){if($("locationDescription").emptyVal)return disableObjects('Bitte geben Sie einen Suchort an!\x3cbr\x3ez.B.: "Stra\x26szlig;e, PLZ", "Stra\x26szlig;e, Ort", "Stadtteil, Ort"'),!0;new Effect.Fade("noResultView",{duration:.4});return!1}if("region"==Configuration.SEARCH_TYPE||"none"==Configuration.SEARCH_TYPE){if(Configuration.STATIC_VIEW)return new Effect.Appear("noResultView",{duration:.4}), !0;new Effect.Fade("noResultView",{duration:.4});return!1}} function createYahooDualSlider(a){YAHOO.namespace("sliders");var b=YAHOO.util.Dom,c=a.initialRange.clone();""!=b.get(a.inputMin).value&&(c[0]=Math.abs(parseInt(b.get(a.inputMin).value,10)|0));""!=b.get(a.inputMax).value&&(c[1]=Math.abs(parseInt(b.get(a.inputMax).value,10)|0));$(a.inputMin).value=c[0];$(a.inputMax).value=c[1];$(a.inputMin).oldValue=$(a.inputMin).value;$(a.inputMax).oldValue=$(a.inputMax).value;void 0!=a.values&&(a.range=[1,a.values.length]);var d=void 0==a.tickSize?0:a.tickSize;if(void 0!= a.convertFn&&void 0!=a.revConvertFn)var f=a.convertFn,e=a.revConvertFn;else var h=(a.range[1]-a.range[0])/110,f=function(b){b=Math.round(b*h+a.range[0]);return void 0==a.values?b:a.values[b-1]},e=function(b){void 0!=a.values&&(b=a.values.indexOf(b)+1);return Math.round((b-a.range[0])/h)};YAHOO.util.Event.onDOMReady(function(){var n=b.get(a.sliderBody),k=b.get(a.inputMin),g=b.get(a.inputMax),m=YAHOO.widget.Slider.getHorizDualSlider(n,a.sliderMinThumb,a.sliderMaxThumb,120,d,[e(c[0]),e(c[1])+10]),n= function(){m.activeSlider==m.minSlider?k.value=m.minVal==m.maxVal-10?g.value:f(m.minVal):g.value=m.minVal==m.maxVal-10?k.value:f(m.maxVal-10)};m.subscribe("ready",n);m.subscribe("change",n);m.subscribe("slideEnd",function(b){if(void 0==k.oldValue||k.oldValue!=k.value||void 0==g.oldValue||g.oldValue!=g.value){if(void 0!=a.onChange)a.onChange();k.oldValue=k.value;g.oldValue=g.value}});var h=function(b){var c=Math.abs(parseInt(k.value,10)|0),d=Math.abs(parseInt(g.value,10)|0);if(null!=a.values){if(-1== a.values.indexOf(c))for(i=0;ic){c=0==i?a.values[i]:a.values[i-1];break}if(-1==a.values.indexOf(d))for(i=0;id){d=a.values[i];break}}if(c>d)var f=c,c=d,d=f;c=Math.max(c,void 0!=a.values?a.values[0]:a.range[0]);d=Math.min(d,void 0!=a.values?a.values[a.values.length-1]:a.range[1]);m.setValues(e(c),e(d)+10,!1,!1,!0);k.value=c;g.value=d;if(void 0!=a.onChange&&void 0==b&&("string"!=typeof b||"string"==typeof b&&"stopOnChange"==b))a.onChange()}, n=function(a){void 0!=a&&13==a.keyCode&&(Event.stop(a),h())};YAHOO.util.Event.on(a.inputMin,"change",h);YAHOO.util.Event.on(a.inputMax,"change",h);YAHOO.util.Event.on(a.inputMax,"keypress",n);YAHOO.util.Event.on(a.inputMin,"keypress",n);$(a.inputMin).fireChanged=h;$(a.inputMax).fireChanged=h;m.subscribe("ready",function(){k.value=c[0];g.value=c[1];k.oldValue=k.value;g.oldValue=g.value});YAHOO.sliders[a.name]=m})} function createYahooSlider(a){YAHOO.namespace("sliders");var b=YAHOO.util.Dom,c=a.initialValue;void 0!=a.inputField&&""!=$(a.inputField).value&&(c=Math.abs(parseInt($(a.inputField).value,10)|0));void 0!=a.displayContainer&&""!=$(a.displayContainer).innerHTML&&(c=Math.abs(parseInt($(a.displayContainer).innerHTML,10)|0));void 0!=a.inputField?($(a.inputField).value=c,$(a.inputField).oldValue=c):void 0!=a.displayContainer&&($(a.displayContainer).innerHTML=c,$(a.displayContainer).oldValue=""+c);void 0!= a.values&&(a.range=[1,a.values.length-2]);var d=void 0==a.tickSize?0:a.tickSize;if(void 0!=a.convertFn&&void 0!=a.revConvertFn)var f=a.convertFn,e=a.revConvertFn;else var h=(a.range[1]-a.range[0])/110,f=function(b){if(void 0!=a.values){if(0==b)return a.values[0];if(120==b)return a.values[a.values.length-1]}b=Math.round(b*h+a.range[0]);return void 0==a.values?b:a.values[b]},e=function(b){void 0!=a.values&&(b=a.values.indexOf(b));return Math.round((b-a.range[0])/h)};YAHOO.util.Event.onDOMReady(function(){var h= b.get(a.sliderBody),k=YAHOO.widget.Slider.getHorizSlider(h,a.sliderThumb,0,120,d),h=function(){void 0!=a.inputField?b.get(a.inputField).value=f(k.getValue()):void 0!=a.displayContainer&&($(a.displayContainer).innerHTML=f(k.getValue()))};k.subscribe("ready",h);k.subscribe("change",h);k.subscribe("slideEnd",function(c){var d,e;void 0!=a.inputField?(e=b.get(a.inputField).value,d=b.get(a.inputField).oldValue):void 0!=a.displayContainer&&(e=$(a.displayContainer).innerHTML,d=$(a.displayContainer).oldValue); if(void 0==d||d!=e){if(void 0!=a.onChange)a.onChange();void 0!=a.inputField?b.get(a.inputField).oldValue=e:void 0!=a.displayContainer&&($(a.displayContainer).oldValue=e)}});h=function(){var c;void 0!=a.inputField?c=Math.abs(parseInt(b.get(a.inputField).value,10)|0):void 0!=a.displayContainer&&(c=Math.abs(parseInt(b.get(a.displayContainer).innerHTML,10)|0));if(null!=a.values&&-1==a.values.indexOf(c))for(i=0;ic){c=0==i?a.values[i]:a.values[i-1];break}c=Math.max(c, void 0!=a.values?a.values[0]:a.range[0]);c=Math.min(c,void 0!=a.values?a.values[a.values.length-1]:a.range[1]);k.setValue(e(c),!1,!1,!0);void 0!=a.inputField?b.get(a.inputField).value=c:void 0!=a.displayContainer&&(b.get(a.displayContainer).innerHTML=c)};void 0!=a.inputField?(YAHOO.util.Event.on(a.inputField,"change",h),YAHOO.util.Event.on(a.inputField,"keypress",function(b){if(13==b.keyCode&&(a.onInputChange(),void 0!=a.onChange))a.onChange()})):void 0!=a.displayContainer&&($(a.displayContainer).fireChanged= h);k.setValue(e(c));YAHOO.sliders[a.name]=k})} function initButtons(){var a=document.getElementsByClassName("immoButton");for(i=0;if?a&&(d.style.height=parseInt(d.style.height)+2+"px"):a&&(d.style.height=parseInt(d.style.height)+1+"px")}else Prototype.Browser.Opera?(b=getCssRule(".imagesnavLeft"),c=getCssRule(".imagesnavRight"),a&&(f=getCssRule(".detailMapCanvasWrapper")),b.style.top=parseInt(b.style.top)-2+"px",c.style.top=parseInt(c.style.top)-2+"px",a&&($("tabContent6").className="tabContent mapTabContentForOpera", f.style.top="0px",f.style.left="0px")):navigator.userAgent.match(/.*Safari.*/)?(b=getCssRule(".imagesnavLeft"),c=getCssRule(".imagesnavRight"),a&&(d=getCssRule(".detailMapCanvas"),f=getCssRule(".detailMapCanvasWrapper")),b.style.top=parseInt(b.style.top)-2+"px",c.style.top=parseInt(c.style.top)-2+"px"):Prototype.Browser.Gecko&&(b=getCssRule(".imagesnavLeft"),c=getCssRule(".imagesnavRight"),b.style.top=parseInt(b.style.top)-2+"px",c.style.top=parseInt(c.style.top)-2+"px")}} function showNotepadeHint(a){void 0==a||1==a?($("bubbleAddedText").style.display="",$("bubbleRemovedText").style.display="none"):($("bubbleAddedText").style.display="none",$("bubbleRemovedText").style.display="");a=document.getElementsByClassName("bubble")[0];"none"==a.style.display&&(new Effect.Appear(a,{duration:.5}),setTimeout(hideNotepadeHint,4E3))}function hideNotepadeHint(){var a=document.getElementsByClassName("bubble")[0];"none"!=a.style.display&&new Effect.Fade(a,{duration:.5})} function showLoading(a,b){if(void 0!=b)return b.syule.display="",b;var c=a.cumulativeOffset(),d=a.getDimensions(),f=document.createElement("div");f.className="loadingMainLayer";makeSamePosAndSize(f,c,d);c=document.createElement("div");c.className="loadingLayer";f.appendChild(c);makeSameSize(c,d);d=document.createElement("div");d.className="loadingIcon";f.appendChild(d);document.body.appendChild(f);f.style.display="";return f}function hideLoading(a){a.style.display="none"} function makeSamePosAndSize(a,b,c){void 0!=b&&(a.style.top=b.top+"px",a.style.left=b.left+"px");makeSameSize(a,c)}function makeSameSize(a,b){void 0!=b&&(a.style.width=b.width+"px",a.style.height=b.height+"px")}function excapeNewLines(a){return a.replace(/\r?\n/g,"\x3cbr\x3e")};